package oop2.Task;

import java.util.Scanner;

public class CompanyOperate {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Company a = new Company();
        a.name = "讯通科技";
        a.address = "合肥市蜀山区繁华大道160号";
        a.phoneNum = "13257668980";
        a.service = "软件开发及硬件维护";
        int choice = 0;

        while (true) {
            System.out.println("1:查看公司信息，2:加入新招聘的员工，3:查看员工信息，4:辞退员工，5:退出");
            choice = input.nextInt();
            if (choice == 1) {
                System.out.println("--查看公司信息--");
                a.showCompany();
            } else if (choice == 2) {
                System.out.println("--加入新招聘的员工--");
                System.out.print("输入新员工的名字:");
                String staffName = input.next();
                a.addStaff(staffName);
            } else if (choice == 3) {
                System.out.println("--查看员工信息--");
                a.showStaff();
            } else if (choice == 4) {
                System.out.println("--辞退员工--");
                System.out.print("输入要辞退的员工的名字:");
                String staffName = input.next();
                a.dismiss(staffName);
            } else if (choice == 5) {
                System.out.println("退出");
                break;
            }

        }
    }
}
